package com.imooc.web.controller;

import com.imooc.base.ApiResponse;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by 瓦力.
 */
@Controller
public class HomeController {
    @GetMapping("/")
   public String index(Model model){
        model.addAttribute("zz","zz");
        return "index";

   }

    @GetMapping("/get")
    @ResponseBody
    public ApiResponse get(Model model){
        model.addAttribute("zz","zz");
        return ApiResponse.ofSuccess("11");

    }
    @GetMapping("/get1")
    public String get1(Model model){
        model.addAttribute("zz","zz");
        return "404";

    }
}
